home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3 / f90 / dim.z / dim
Encoding:
Text File  |  2002-10-03  |  3.3 KB  |  92 lines

  1. DIM(3I)                                               Last changed: 4-13-99
  2.  
  3.  
  4. NNAAMMEE
  5.      DDIIMM, DDDDIIMM, QQDDIIMM, IIDDIIMM, IIIIDDIIMM, JJIIDDIIMM, KKIIDDIIMM - Computes positive
  6.      difference of two numbers
  7.  
  8. SSYYNNOOPPSSIISS
  9.      DDIIMM (([XX==]_x,,[YY==]_y))
  10.      DDDDIIMM (([XX==]_x,,[YY==]_y))
  11.      QQDDIIMM (([XX==]_x,,[YY==]_y))
  12.      IIDDIIMM (([XX==]_x,,[YY==]_y))
  13.      IIIIDDIIMM (([XX==]_x,,[YY==]_y))
  14.      JJIIDDIIMM (([XX==]_x,,[YY==]_y))
  15.      KKIIDDIIMM (([XX==]_x,,[YY==]_y))
  16.  
  17. IIMMPPLLEEMMEENNTTAATTIIOONN
  18.      UNICOS, UNICOS/mk, IRIX systems
  19.  
  20.      CF90, MIPSpro 7 Fortran 90, MIPSpro Fortran 77
  21.  
  22. SSTTAANNDDAARRDDSS
  23.      Fortran
  24.  
  25.      Fortran extensions:  QQDDIIMM, IIIIDDIIMM, JJIIDDIIMM, KKIIDDIIMM
  26.  
  27. DDEESSCCRRIIPPTTIIOONN
  28.      DDIIMM is the generic function name; the others are specifics.  These are
  29.      elemental intrinsic functions.  They accept the following arguments:
  30.  
  31.      _x         Must be of type integer or real.
  32.  
  33.      _y         Must be of the same type and kind type as _x.
  34.  
  35.      These functions solve for:
  36.  
  37.           _R = _x  - _x , if _x  > _x
  38.                1    2      1    2
  39.           _R = 0, if _x  <= _x
  40.                      1     2
  41. NNOOTTEESS
  42.      The DDIIMM, IIDDIIMM, and DDDDIIMM intrinsic funtion names can be passed as
  43.      arguments; the others cannot.
  44.  
  45. RREETTUURRNN VVAALLUUEESS
  46.      DDIIMM evaluates two real numbers and subtracts them.  The result is a
  47.      real positive difference.
  48.  
  49.      DDDDIIMM evaluates two double-precision real numbers and subtracts them.
  50.      The result is a double-precision real positive difference.
  51.  
  52.      QQDDIIMM evaluates two quad-precision real numbers and subtracts them.
  53.      The result is a quad-precision real positive difference.
  54.  
  55.      IIDDIIMM evaluates two integers and subtracts them.  The result is an
  56.      integer positive difference.
  57.  
  58.      IIIIDDIIMM evaluates two integer (KIND=2) numbers and subtracts them.  The
  59.      result is an integer (KIND=2) positive difference.
  60.  
  61.      JJIIDDIIMM evaluates two integer (KIND=4) numbers and subtracts them.  The
  62.      result is an integer (KIND=4) positive difference.
  63.  
  64.      KKIIDDIIMM evaluates two integer (KIND=8) numbers and subtracts them.  The
  65.      result is an integer (KIND=8) positive difference.
  66.  
  67. EEXXAAMMPPLLEESS
  68.      The following program shows the use of IIDDIIMM to compute the positive
  69.      difference between the integers 77 and 10:
  70.  
  71.                PROGRAM DIMTEST
  72.                INTEGER A,B,C,D,E
  73.                A = 77
  74.                B = 10
  75.                C = IDIM(A,B)
  76.                WRITE 1,A,B,C
  77.             1  FORMAT(I2,'POSITIVE DIFFERENCE ',I2,' EQUALS ', I2)
  78.                D = IDIM(B,A)
  79.                WRITE 2,B,A,D
  80.             2  FORMAT(I2,'POSITIVE DIFFERENCE ',I2,' EQUALS ',I2)
  81.                STOP
  82.                END
  83.  
  84.      The example program gives the following output:
  85.  
  86.           77 POSITIVE DIFFERENCE 10 EQUALS 67
  87.           10 POSITIVE DIFFERENCE 77 EQUALS  0
  88.  
  89. SSEEEE AALLSSOO
  90.      _I_n_t_r_i_n_s_i_c _P_r_o_c_e_d_u_r_e_s _R_e_f_e_r_e_n_c_e _M_a_n_u_a_l for the printed version of this
  91.      man page.
  92.